home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / misc / edu / Calgor.lha / Cal / Algorithms / array.c next >
Encoding:
C/C++ Source or Header  |  1996-03-21  |  723 b   |  24 lines

  1. #include<hold/anim.h>
  2.  
  3. /* 000 */ void array_control(void){
  4. /* 001 */ int ARY[5] = {12,14,15,16,17};
  5. /* 002 */ int index = 4;
  6. /* 003 */ int value = 4;
  7.             a_func("array_control",0);
  8.             a_irayini(ARY,"ARY",5,1);
  9.             a_intini(index,"index",2);
  10.             a_intini(value,"value",3);
  11.             a_intass("index","4",4);
  12.             a_intcomp("index > -1",4);
  13. /* 004 */   for(index=4;index>-1;index--){
  14. /* 005 */     value = ARY[index];
  15.               a_intass("value","ARY[index]",5);
  16.               a_intass("index","index-1",4);
  17.               a_intcomp("index>-1",4);
  18. /* 006 */   }
  19. /* 007 */   ARY[4] = 13;
  20.             a_intass("ARY[4]","13",7);
  21.             a_endfunc("array_control",8);
  22. /* 007 */ }
  23.  
  24.